package com.example.project.manageController;

import com.example.project.dao.AdminDAO;
import com.example.project.dao.ParkingDAO;
import com.example.project.pojo.Parking;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Date;
import java.util.List;

@Controller
@RequestMapping("manage")
public class ManageFindEndTime {
    @RequestMapping("findendtime")
   public String findEndTime(Model model)
   {
       ParkingDAO parkingDAO = new ParkingDAO();
       List<Parking> parkingList =parkingDAO.showEndTime();
       model.addAttribute("parkingList",parkingList);
       return "manage/findEndTime";
   }
    @RequestMapping("showStatus")
//    @ResponseBody
    public String showStatus(Integer id)
    {
        ParkingDAO parkingDAO=new ParkingDAO();
        parkingDAO.updateStatus(id);
        return "redirect:/manage/findendtime";
    }
}
